//
//  MonitoringTableViewCell.m
//  ZhangJiangJun
//
//  Created by FENGYL on 2017/1/21.
//  Copyright © 2017年 FENGYL. All rights reserved.
//

#import "MonitoringTableViewCell.h"

@interface MonitoringTableViewCell()

@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UIImageView *eventImageView;
@property (weak, nonatomic) IBOutlet UILabel *eventLabel;

@end

@implementation MonitoringTableViewCell

-(void)setTime:(NSString *)time alarmType:(NSNumber *)alarmType message:(NSString *)message{
    
    [self.timeLabel setText:time];
    
    if ([alarmType isEqual:@46] || [alarmType isEqual:@47]) {
        
        [self.eventImageView setImage:[UIImage imageNamed:@"zjj_lishi_icon3"]];
        
        [self.eventLabel setTextColor:[UIColor redColor]];
        
    }else{
        
        [self.eventImageView setImage:[UIImage imageNamed:@"zjj_lishi_icon2"]];
        
        [self.eventLabel setTextColor:[UIColor blackColor]];
        
    }
    
    NSString * typeName = [NSString stringWithFormat:@"TypeIDStr%@",alarmType];
    
    [self.eventLabel setText:NSLocalizedString(typeName, nil)];
    
    if (([alarmType isEqual:@12] || [alarmType isEqual:@13]) && message) {
        
        [self.eventLabel setText:[NSString stringWithFormat:@"%@(%@)",NSLocalizedString(typeName, nil),message]];
        
    }
    
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
